package com.lin.service.orders;

import com.lin.common.utils.DateUtils;
import com.lin.dao.OrdersMapper;
import com.lin.po.Orders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Base64;

public class OrdersServiceImpl implements OrdersService {
    private static final Logger log = LoggerFactory.getLogger(OrdersServiceImpl.class);
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public int orderStatusUpdate(Long orderNo) {
        Orders o = new Orders();
        o.setOrderNo(orderNo);
        o.setTrxStatus(Orders.TRX_STATUS_PAY_SUCCESS);
        o.setPayTime(DateUtils.fullDateFormat());
        o.setUpdateTime(DateUtils.fullDateFormat());
        return ordersMapper.updateByPrimaryKeySelective(o);
    }

    public static void main(String[] args) {
        String s="AZib_e-Xfb0VvWhLkUrFcYEkTkOCiofHuS0NwTOViD51I3GVKyyx3wg3XDb9Ubn6NJBvE-awgjNU0lZ-:EGcVxcChgaGaB4b8-aAZy5uN7gDA-53cK0sscSJJBOlT19xdqHt8gVnjuOjYM1HhcyAdOZJnqcZeHHhM";
        System.out.println(Base64.getEncoder().encodeToString(s.getBytes()));
    }
}
